package com.example.demo.netty.chat_room.domain;

import java.util.Arrays;

/**
 * 数据包类
 */
public class MessageProtocol {

    // 消息长度
    private Integer length;
    // 消息内容
    private byte[] data;

    @Override
    public String toString() {
        return "MessageProtocol{" +
                "length=" + length +
                ", data=" + Arrays.toString(data) +
                '}';
    }

    public MessageProtocol(Integer length, byte[] data) {
        this.length = length;
        this.data = data;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }
}


